﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace GosWeb.Models.Db
{
    public class OtherParameter
    {
        [Key]
        public Int32 ParamID { get; set; }
        
        [Display(Name = "类型")]
        public Int16 ParaType { get; set; }
        [Display(Name = "代码")]
        [StringLength(2, ErrorMessage = "长度最长为2")]
        public string Code { get; set; }
        [Display(Name = "值")]
        [StringLength(20, ErrorMessage = "长度最长为20")]
        public string Value { get; set; }
    }

    public enum ParamType : short
    {
        Site = 1,
        CompanName
    }

    public class ParamTypeList
    {
        public Int16 Type { get; set; }
        public string Name { get; set; }

        public static IEnumerable<ParamTypeList> ParamTypes
        {
            get
            {
                var pts = new List<ParamTypeList>(){  
                    new ParamTypeList{Type = 1,Name="场" },
                    new ParamTypeList{Type = 2,Name="公司" }
            };
                return pts;
            }
        }
    }
}